import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@RestController
@CrossOrigin(origins = "*") // 允许跨域
@RequestMapping("/gg")
public class GgController {

    private static final Logger logger = LoggerFactory.getLogger(GgController.class);

    @Autowired
    private GgService ggService;

    // 查询所有已发布的公告（前台展示用）
    @GetMapping("/published")
    public List<Gg> findPublished() {
        logger.info("findPublished method is called"); // 添加日志记录
        return ggService.findPublished();
    }
}